﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace OnTheWay.Functions
{
    public class FunctionEntity : INotifyPropertyChanged
    {
        // Fields
        private bool _IsCurrent = false;

        // Events
        public event PropertyChangedEventHandler PropertyChanged;

        // Methods
        internal FunctionEntity(FunctionCtrl ctrl, bool iscur)
        {
            this.Ctrl = ctrl;
            this.IsCurrent = iscur;
        }

        protected void NotifyPropertyChanged(string property)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }

        // Properties
        public FunctionCtrl Ctrl { get; set; }

        public bool IsCurrent
        {
            get
            {
                return this._IsCurrent;
            }
            set
            {
                this._IsCurrent = value;
                this.NotifyPropertyChanged("IsCurrent");
            }
        }

        public string Title
        {
            get
            {
                return this.Ctrl.Title;
            }
        }
    }



}
